Toward a Feasible Functional Logic Compiler Employing Fair Search
نویسنده
چکیده
Traditionally, implementations for functional logic languages (FLP) have used depth-first search to implement narrowing, a well-known search strategy. While this approach yields good performance, it is unnecessarily restrictive in the sense that some programs lead to non-termination (the search computes forever in one part of the search space, failing to consider the rest) when clearly they should yield results. As a result, a number of recent FLP research efforts have focused on designing efficient FLP systems based on breadth-first search strategies, which hold an important fairness property: if a solution is known to exist, it will (eventually) be found. The work presented in this paper addresses issues of efficiency in the context of FLC, a FLP compiler that employs fair search and a novel application of first-class stores in its implementation of narrowing. We show that in order to be tractable, FLC needs an efficient data representation for first-class stores and an efficient garbage collector. We discuss and compare several data representations for first-class stores, and show that a hashing-based data structure exhibits desirable performance. We show that proper collection of an efficient first-class store data representation in FLC involves additional work in the collector, to collect some reachable values which are known to be garbage. We describe the implementation of a complete generational copy collector that correctly handles collection of first-class store data structures. Finally, we evaluate the performance of the complete system, showing favorable results.
منابع مشابه
A New Functional-Logic Compiler for Curry: Sprite
We introduce a new native code compiler for Curry codenamed Sprite. Sprite is based on the Fair Scheme, a compilation strategy that provides instructions for transforming declarative, non-deterministic programs of a certain class into imperative, deterministic code. We outline salient features of Sprite, discuss its implementation of Curry programs, and present benchmarking results. Sprite is t...
متن کاملIntegration of Finite Domain Constraints
A constraint programming system usually consists of two main components: a modelling language used to describe a constraint satisfaction problem and a constraint solver searching for solutions to the given problem by applying specific algorithms. As constraint programming and functional logic languages share some common features, like computing with logic variables or the use of backtracking fo...
متن کاملTransforming Functional Logic Programs into Monadic Functional Programs
We present a high-level transformation scheme to translate lazy functional logic programs into pure Haskell programs. This transformation is based on a recent proposal to efficiently implement lazy non-deterministic computations in Haskell in a monadic style. We build on this work and define a systematic method to transform lazy functional logic programs into monadic programs with explicit shar...
متن کاملConstrained Novelty Search: A Study on Game Content Generation
Novelty search is a recent algorithm geared toward exploring search spaces without regard to objectives. When the presence of constraints divides a search space into feasible space and infeasible space, interesting implications arise regarding how novelty search explores such spaces. This paper elaborates on the problem of constrained novelty search and proposes two novelty search algorithms wh...
متن کاملKiCS2: A New Compiler from Curry to Haskell
In this paper we present our first steps towards a new system to compile functional logic programs of the source language Curry into purely functional Haskell programs. Our implementation is based on the idea to represent non-deterministic results as values of the data types corresponding to the results. This enables the application of various search strategies to extract values from the search...
متن کامل